
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>CubeMX配置及主要参数 · STM32HAL系列教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Atonidas">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="OLED驱动移植.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
         

<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://Gitee.com/atonidas" target="_blank">Gitee</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../软件环境/">
            
                <a href="../软件环境/">
            
                    
                    软件环境
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../软件环境/VScode的使用.html">
            
                <a href="../软件环境/VScode的使用.html">
            
                    
                    VScode快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../软件环境/VSCode插件分享.html">
            
                <a href="../软件环境/VSCode插件分享.html">
            
                    
                    VScode插件分享
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../软件环境/CubeMX简介.html">
            
                <a href="../软件环境/CubeMX简介.html">
            
                    
                    CubeMX简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../软件环境/创建一个工程.html">
            
                <a href="../软件环境/创建一个工程.html">
            
                    
                    创建一个工程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../软件环境/Git版本管理.html">
            
                <a href="../软件环境/Git版本管理.html">
            
                    
                    Git版本管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../软件环境/创建一个快速开发模板.html">
            
                <a href="../软件环境/创建一个快速开发模板.html">
            
                    
                    创建一个快速开发模板
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../STM32的IO口/">
            
                <a href="../STM32的IO口/">
            
                    
                    STM32的IO口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../STM32的IO口/点亮一个LED.html">
            
                <a href="../STM32的IO口/点亮一个LED.html">
            
                    
                    点亮一个LED
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../STM32的IO口/使用独立按键.html">
            
                <a href="../STM32的IO口/使用独立按键.html">
            
                    
                    使用独立按键
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../STM32中断/">
            
                <a href="../STM32中断/">
            
                    
                    STM32中断
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../STM32中断/CubeMX外部中断配置.html">
            
                <a href="../STM32中断/CubeMX外部中断配置.html">
            
                    
                    CubeMX外部中断配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../STM32中断/HAL库外部中断程序.html">
            
                <a href="../STM32中断/HAL库外部中断程序.html">
            
                    
                    HAL库外部中断程序
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../STM32定时器/">
            
                <a href="../STM32定时器/">
            
                    
                    STM32定时器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../STM32定时器/定时器简单中断程序.html">
            
                <a href="../STM32定时器/定时器简单中断程序.html">
            
                    
                    定时器简单中断程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../STM32定时器/硬件PWM输出.html">
            
                <a href="../STM32定时器/硬件PWM输出.html">
            
                    
                    硬件PWM输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../STM32定时器/DMA输出PWM控制WS2812.html">
            
                <a href="../STM32定时器/DMA输出PWM控制WS2812.html">
            
                    
                    DMA输出PWM控制WS2812
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../STM32串口/">
            
                <a href="../STM32串口/">
            
                    
                    STM32串口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../STM32串口/串口发送及中断接收.html">
            
                <a href="../STM32串口/串口发送及中断接收.html">
            
                    
                    串口发送及中断接收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../STM32串口/串口的格式化输出.html">
            
                <a href="../STM32串口/串口的格式化输出.html">
            
                    
                    串口的格式化输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../STM32串口/串口DMA传输.html">
            
                <a href="../STM32串口/串口DMA传输.html">
            
                    
                    串口DMA传输
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../STM32串口/简单协议编写.html">
            
                <a href="../STM32串口/简单协议编写.html">
            
                    
                    简单协议编写
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="./">
            
                <a href="./">
            
                    
                    SPI协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.7.1" data-path="CubeMX配置及主要函数.html">
            
                <a href="CubeMX配置及主要函数.html">
            
                    
                    CubeMX配置及主要参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="OLED驱动移植.html">
            
                <a href="OLED驱动移植.html">
            
                    
                    OLED驱动移植
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="LVGL移植显示.html">
            
                <a href="LVGL移植显示.html">
            
                    
                    LVGL移植显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="Flash的使用及文件系统.html">
            
                <a href="Flash的使用及文件系统.html">
            
                    
                    Flash的使用及文件系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ADC的使用/">
            
                <a href="../ADC的使用/">
            
                    
                    ADC的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ADC的使用/CubeMX中ADC配置概览.html">
            
                <a href="../ADC的使用/CubeMX中ADC配置概览.html">
            
                    
                    CubeMX中ADC配置概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../ADC的使用/查询阻塞方式.html">
            
                <a href="../ADC的使用/查询阻塞方式.html">
            
                    
                    查询阻塞方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../ADC的使用/中断方式.html">
            
                <a href="../ADC的使用/中断方式.html">
            
                    
                    中断方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../ADC的使用/DMA方式.html">
            
                <a href="../ADC的使用/DMA方式.html">
            
                    
                    DMA方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../ADC的使用/应用示例.html">
            
                <a href="../ADC的使用/应用示例.html">
            
                    
                    应用示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../其他代码整合搬运/">
            
                <a href="../其他代码整合搬运/">
            
                    
                    其他代码整合搬运
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../其他代码整合搬运/MultiButton.html">
            
                <a href="../其他代码整合搬运/MultiButton.html">
            
                    
                    MultiButton
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../其他代码整合搬运/EasyLogger.html">
            
                <a href="../其他代码整合搬运/EasyLogger.html">
            
                    
                    EasyLogger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../其他代码整合搬运/letter-shell.html">
            
                <a href="../其他代码整合搬运/letter-shell.html">
            
                    
                    letter-shell
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../其他代码整合搬运/EasyFlash.html">
            
                <a href="../其他代码整合搬运/EasyFlash.html">
            
                    
                    EasyFlash
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../其他代码整合搬运/时间片调度.html">
            
                <a href="../其他代码整合搬运/时间片调度.html">
            
                    
                    时间片调度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../加入我们/">
            
                <a href="../加入我们/">
            
                    
                    加入我们
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../加入我们/Gitbook环境.html">
            
                <a href="../加入我们/Gitbook环境.html">
            
                    
                    Gitbook环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../加入我们/Markdown语法简介.html">
            
                <a href="../加入我们/Markdown语法简介.html">
            
                    
                    Markdown语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../加入我们/编辑器推荐.html">
            
                <a href="../加入我们/编辑器推荐.html">
            
                    
                    编辑器推荐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../加入我们/工程文件说明.html">
            
                <a href="../加入我们/工程文件说明.html">
            
                    
                    工程文件说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../加入我们/提交注意事项.html">
            
                <a href="../加入我们/提交注意事项.html">
            
                    
                    提交注意事项
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >CubeMX配置及主要参数</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h1 id="cubemx&#x914D;&#x7F6E;spi">CubeMX&#x914D;&#x7F6E;SPI</h1>
<blockquote>
<p><a href="https://blog.csdn.net/weixin_41082463/article/details/104952605" target="_blank">&#x53C2;&#x8003;&#x535A;&#x5BA2;</a></p>
</blockquote>
<h2 id="cubemx&#x5177;&#x4F53;&#x53C2;&#x6570;&#x914D;&#x7F6E;">CubeMX&#x5177;&#x4F53;&#x53C2;&#x6570;&#x914D;&#x7F6E;</h2>
<h3 id="spi&#x57FA;&#x672C;&#x8BBE;&#x7F6E;">SPI&#x57FA;&#x672C;&#x8BBE;&#x7F6E;</h3>
<p>&#x548C;&#x4E32;&#x53E3;&#x4E00;&#x6837;&#xFF0C;SPI&#x7684;&#x5916;&#x8BBE;&#x914D;&#x7F6E;&#x4E00;&#x6837;&#x662F;&#x5728;CubeMX&#x7684;<strong>Connectivity</strong>&#x4E00;&#x680F;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x968F;&#x610F;&#x6253;&#x5F00;&#x4E00;&#x4E2A;SPI&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x53EF;&#x4EE5;&#x914D;&#x7F6E;&#x5982;&#x4E0B;&#x6A21;&#x5F0F;&#xFF1A;</p>
<table>
<thead>
<tr>
<th style="text-align:center">&#x6A21;&#x5F0F;</th>
<th style="text-align:center">&#x542B;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Full-Duplex Master</td>
<td style="text-align:center">&#x5168;&#x53CC;&#x5DE5;&#x4E3B;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Full-Duplex Slave</td>
<td style="text-align:center">&#x5168;&#x53CC;&#x5DE5;&#x4ECE;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Half-Duplex Master</td>
<td style="text-align:center">&#x534A;&#x53CC;&#x5DE5;&#x4E3B;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Half-Duplex Slave</td>
<td style="text-align:center">&#x534A;&#x53CC;&#x5DE5;&#x4ECE;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Receive Only Master</td>
<td style="text-align:center">&#x4EC5;&#x63A5;&#x6536;&#x4E3B;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Receive Only Slave</td>
<td style="text-align:center">&#x4EC5;&#x63A5;&#x6536;&#x4ECE;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Transmit Only Master</td>
<td style="text-align:center">&#x4EC5;&#x53D1;&#x9001;&#x4E3B;&#x6A21;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">Transmit Only Slave</td>
<td style="text-align:center">&#x4EC5;&#x53D1;&#x9001;&#x4ECE;&#x6A21;&#x5F0F;</td>
</tr>
</tbody>
</table>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x53EF;&#x4EE5;&#x6309;&#x7167;&#x662F;&#x5426;&#x53CC;&#x5411;&#x901A;&#x4FE1;&#xFF0C;&#x53CC;&#x5411;&#x901A;&#x4FE1;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x4EE5;&#x53CA;&#x4E3B;&#x673A;\&#x4ECE;&#x673A;&#x8FDB;&#x884C;&#x6362;&#x5206;&#xFF1A;</p>
<ul>
<li><strong>&#x5168;&#x53CC;&#x5DE5;&#xFF1A;</strong> &#x53EF;&#x4EE5;<strong>&#x540C;&#x65F6;</strong>&#x8FDB;&#x884C;&#x53D1;&#x9001;&#x548C;&#x63A5;&#x6536;</li>
<li><strong>&#x534A;&#x53CC;&#x5DE5;&#xFF1A;</strong> &#x53EF;&#x4EE5;<strong>&#x5206;&#x65F6;</strong>&#x8FDB;&#x884C;&#x53D1;&#x9001;&#x548C;&#x63A5;&#x6536;</li>
<li><strong>&#x4ECE;&#x673A;&#x548C;&#x4E3B;&#x673A;&#xFF1A;</strong>&#x901A;&#x4FE1;&#x65F6;&#x7684;<strong>&#x65F6;&#x949F;&#x7EBF;</strong>&#x7531;&#x4E3B;&#x673A;&#x63A7;&#x5236;</li>
</ul>
<p>&#x9009;&#x62E9;&#x597D;&#x901A;&#x4FE1;&#x6A21;&#x5F0F;&#x540E;&#x53EF;&#x4EE5;&#x5BF9;&#x76F8;&#x5E94;&#x53C2;&#x6570;&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#xFF1A;</p>
<p><img src="assets/SPI&#x53C2;&#x6570;.png" alt="SPI&#x53C2;&#x6570;"></p>
<p>&#x6211;&#x4EEC;&#x4E3B;&#x8981;&#x5173;&#x6CE8;&#x4EE5;&#x4E0B;&#x51E0;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;</p>
<table>
<thead>
<tr>
<th>&#x53C2;&#x6570;</th>
<th>&#x8BBE;&#x7F6E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>Frame Format&#xFF08;&#x5E27;&#x683C;&#x5F0F;&#xFF09;</td>
<td>&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x6469;&#x6258;&#x7F57;&#x62C9;&#x548C;TI&#xFF0C;&#x9ED8;&#x8BA4;Motorola</td>
</tr>
<tr>
<td>Data Size&#xFF08;&#x6570;&#x636E;&#x957F;&#x5EA6;&#xFF09;</td>
<td>&#x6839;&#x636E;&#x60C5;&#x51B5;&#x9009;&#x62E9;4/8/16bit&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;8Bits</td>
</tr>
<tr>
<td>First Bit&#xFF08;&#x9996;&#x4F4D;&#x7FFB;&#x8F6C;&#xFF09;</td>
<td>&#x51B3;&#x5B9A;&#x6570;&#x636E;&#x662F;&#x9AD8;&#x4F4D;&#x8FD8;&#x662F;&#x5728;&#x524D;&#xFF0C;&#x9ED8;&#x8BA4;MSB First</td>
</tr>
<tr>
<td>Prescaler&#xFF08;&#x5206;&#x9891;&#x7CFB;&#x6570;&#xFF09;</td>
<td>&#x8BBE;&#x7F6E;&#x5206;&#x9891;&#x6570;&#x8C03;&#x6574;SPI&#x65F6;&#x949F;&#x901F;&#x7387;&#xFF0C;&#x89C6;&#x60C5;&#x51B5;&#x8C03;&#x6574;</td>
</tr>
<tr>
<td>NSS Signal Type&#xFF08;&#x7247;&#x9009;&#x65B9;&#x5F0F;&#xFF09;</td>
<td>&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x8F6F;&#x4EF6;&#x6216;&#x786C;&#x4EF6;&#xFF0C;&#x4E3A;&#x81EA;&#x5B9A;&#x4E49;&#x4EFB;&#x610F;&#x5F15;&#x811A;&#x9009;&#x8F6F;&#x4EF6;</td>
</tr>
</tbody>
</table>
<p>&#x524D;&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#x901A;&#x5E38;&#x9ED8;&#x8BA4;&#x8BBE;&#x7F6E;&#x5373;&#x53EF;&#xFF0C;&#x800C;&#x5206;&#x5C4F;&#x7CFB;&#x6570;&#x9700;&#x8981;&#x6CE8;&#x610F;&#xFF0C;&#x8BF7;&#x770B;&#x4E0B;&#x4E00;&#x8282;&#x7684;&#x4ECB;&#x7ECD;</p>
<h3 id="spi&#x65F6;&#x949F;&#x901F;&#x7387;">SPI&#x65F6;&#x949F;&#x901F;&#x7387;</h3>
<p>&#x5F53;&#x6211;&#x4EEC;&#x9A71;&#x52A8;&#x4E00;&#x4E9B;&#x5916;&#x8BBE;&#x65F6;&#xFF0C;&#x7FFB;&#x770B;&#x6570;&#x636E;&#x624B;&#x518C;&#x6216;&#x8005;&#x4EA7;&#x54C1;&#x8BF4;&#x660E;&#x9875;&#xFF0C;&#x80FD;&#x627E;&#x5230;&#x76F8;&#x5E94;&#x5916;&#x8BBE;&#x652F;&#x6301;&#x7684;&#x6700;&#x5927;&#x65F6;&#x949F;&#x9891;&#x7387;&#x3002;</p>
<p>&#x5047;&#x5B9A;&#x6211;&#x4EEC;&#x6253;&#x7B97;&#x4F7F;&#x7528;SPI1&#x9A71;&#x52A8;&#x5916;&#x8BBE;&#xFF0C;&#x4ECE;&#x8BBE;&#x5907;&#x5141;&#x8BB8;&#x7684;&#x6700;&#x5927;&#x65F6;&#x949F;&#x9891;&#x7387;&#x4E3A;20MHz&#xFF0C;&#x600E;&#x4E48;&#x8BA1;&#x7B97;&#x5206;&#x9891;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x95EE;&#x9898;&#x3002;&#x8FD9;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x7FFB;&#x5F00;&#x82AF;&#x7247;&#x7684;&#x6570;&#x636E;&#x624B;&#x518C;&#xFF08;&#x53EF;&#x4EE5;&#x5230;&#x7ACB;&#x521B;&#x5546;&#x57CE;&#x641C;&#x7D22;&#x82AF;&#x7247;&#x578B;&#x53F7;&#x627E;&#x5230;&#xFF09;&#xFF0C;&#x627E;&#x5230;&#x5982;&#x4E0B;&#x65F6;&#x949F;&#x6811;&#x5206;&#x914D;&#xFF1A;</p>
<p><img src="assets/F401&#x90E8;&#x5206;&#x65F6;&#x949F;&#x6811;.png" alt="F401&#x90E8;&#x5206;&#x65F6;&#x949F;&#x6811;"></p>
<p>&#x5728;&#x5DE6;&#x534A;&#x8FB9;&#x53EF;&#x4EE5;&#x770B;&#x5230;SPI1&#x6302;&#x8F7D;&#x5728;APB2&#x4E0B;&#xFF0C;&#x800C;APB2&#x7684;&#x6700;&#x5927;&#x901F;&#x7387;&#x4E3A;84MHz&#xFF0C;&#x5206;&#x9891;&#x6570;&#x662F;2&#x7684;&#x5E42;&#x6709;2/4/8/16&#x7B49;&#x53EF;&#x9009;&#x3002;&#x90A3;&#x4E48;<strong>&#x4E3A;&#x4E86;&#x6EE1;&#x8DB3;SPI1&#x901F;&#x7387;&#x5C0F;&#x4E8E;20MHz&#x7684;&#x9700;&#x6C42;&#xFF0C;&#x5206;&#x9891;&#x6570;&#x81F3;&#x5C11;&#x4E3A;8&#xFF0C;&#x6B64;&#x65F6;SPI1&#x901F;&#x7387;&#x4E3A;10.5MHz</strong></p>
<h2 id="hal&#x5E93;&#x4E2D;spi&#x51FD;&#x6570;&#x4ECB;&#x7ECD;">HAL&#x5E93;&#x4E2D;SPI&#x51FD;&#x6570;&#x4ECB;&#x7ECD;</h2>
<p>&#x548C;&#x4E32;&#x53E3;&#x901A;&#x4FE1;&#x7C7B;&#x4F3C;&#xFF0C;SPI&#x7684;&#x901A;&#x4FE1;&#x51FD;&#x6570;&#x4E5F;&#x662F;<strong>HAL + &#x5916;&#x8BBE; + &#x52A8;&#x4F5C;</strong>&#x7684;&#x65B9;&#x5F0F;&#x5B9A;&#x4E49;&#xFF0C;&#x4E5F;&#x6709;&#x5982;&#x4E0B;&#x51E0;&#x4E2A;&#x7C7B;&#x578B;&#xFF1A;</p>
<table>
<thead>
<tr>
<th style="text-align:center">&#x4F20;&#x8F93;&#x65B9;&#x5411;&#x5BF9;&#x6BD4;</th>
<th style="text-align:center">&#x529F;&#x80FD;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">HAL_SPI_Transmit</td>
<td style="text-align:center">&#x53D1;&#x9001;&#x6570;&#x636E;</td>
</tr>
<tr>
<td style="text-align:center">HAL_SPI_Receive</td>
<td style="text-align:center">&#x63A5;&#x6536;&#x6570;&#x636E;</td>
</tr>
<tr>
<td style="text-align:center">HAL_SPI_TransmitReceive</td>
<td style="text-align:center">&#x5168;&#x53CC;&#x5DE5;&#xFF0C;&#x63A5;&#x6536;&#x548C;&#x53D1;&#x9001;&#x6570;&#x636E;</td>
</tr>
<tr>
<td style="text-align:center"><strong>&#x4F20;&#x8F93;&#x65B9;&#x5F0F;&#x5BF9;&#x6BD4;</strong></td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">HAL_SPI_Transmit</td>
<td style="text-align:center">&#x963B;&#x585E;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">HAL_SPI_Transmit_IT</td>
<td style="text-align:center">&#x4E2D;&#x65AD;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:center">HAL_SPI_Transmit_DMA</td>
<td style="text-align:center">DMA&#x4F20;&#x8F93;</td>
</tr>
</tbody>
</table>
<p>&#x53EF;&#x4EE5;&#x770B;&#x51FA;SPI&#x7684;&#x4F20;&#x8F93;&#x534F;&#x8BAE;&#x7684;&#x51FD;&#x6570;&#x548C;&#x4E32;&#x53E3;&#x7684;&#x5DEE;&#x522B;&#x4E0D;&#x5927;&#xFF0C;&#x90FD;&#x6709;<strong>&#x963B;&#x585E;&#x3001;&#x4E2D;&#x65AD;&#x3001;DMA</strong>&#x4E09;&#x79CD;&#x65B9;&#x5F0F;&#xFF0C;&#x4F46;&#x662F;&#x4E0D;&#x540C;&#x7684;&#x662F;SPI&#x591A;&#x4E86;&#x4E00;&#x4E2A;TransmitReceive&#x51FD;&#x6570;&#xFF0C;&#x8FD9;&#x662F;&#x56E0;&#x4E3A;SPI&#x662F;&#x4E00;&#x4E2A;&#x53EF;&#x4EE5;&#x53CC;&#x5DE5;&#x8FD0;&#x884C;&#x7684;&#x534F;&#x8BAE;&#xFF0C;&#x53D1;&#x9001;&#x548C;&#x63A5;&#x6536;&#x53EF;&#x4EE5;&#x540C;&#x65F6;&#x8FDB;&#x884C;&#x3002;&#x4F7F;&#x7528;SPI&#x901A;&#x4FE1;&#x65F6;&#xFF0C;&#x8BBE;&#x5907;&#x7684;&#x8FDE;&#x7EBF;&#x548C;&#x4E32;&#x53E3;&#x4E0D;&#x592A;&#x4E00;&#x6837;&#xFF0C;&#x5E94;&#x4FDD;&#x8BC1;&#x540D;&#x5B57;&#x76F8;&#x540C;&#x7684;&#x8FDE;&#x5728;&#x4E00;&#x8D77;</p>
<p>&#x5177;&#x4F53;SPI&#x5E94;&#x7528;&#x53C2;&#x8003;<a href="OLED&#x9A71;&#x52A8;&#x79FB;&#x690D;.html">OLED&#x9A71;&#x52A8;&#x79FB;&#x690D;</a></p>
 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
        </div>
      </div>
      
    </div>

     
    <a
      href="./"
      class="
        navigation navigation-prev
        
      "
      aria-label="Previous page: SPI协议"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="OLED驱动移植.html"
      class="
        navigation navigation-next
        
      "
      aria-label="Next page: OLED驱动移植"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"CubeMX配置及主要参数","level":"1.7.1","depth":2,"next":{"title":"OLED驱动移植","level":"1.7.2","depth":2,"path":"SPI协议/OLED驱动移植.md","ref":"./SPI协议/OLED驱动移植.md","articles":[]},"previous":{"title":"SPI协议","level":"1.7","depth":1,"path":"SPI协议/README.md","ref":"./SPI协议/README.md","articles":[{"title":"CubeMX配置及主要参数","level":"1.7.1","depth":2,"path":"SPI协议/CubeMX配置及主要函数.md","ref":"./SPI协议/CubeMX配置及主要函数.md","articles":[]},{"title":"OLED驱动移植","level":"1.7.2","depth":2,"path":"SPI协议/OLED驱动移植.md","ref":"./SPI协议/OLED驱动移植.md","articles":[]},{"title":"LVGL移植显示","level":"1.7.3","depth":2,"path":"SPI协议/LVGL移植显示.md","ref":"./SPI协议/LVGL移植显示.md","articles":[]},{"title":"Flash的使用及文件系统","level":"1.7.4","depth":2,"path":"SPI协议/Flash的使用及文件系统.md","ref":"./SPI协议/Flash的使用及文件系统.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-sharing","-search","-favicon","-code","expandable-chapters","theme-lou","back-to-top-button","search-pro","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"search-pro":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link"],"color":"#8abcd1","copyright":{"author":"Atonidas"},"forbidCopy":false,"logo":"assets/logo.png","search-placeholder":"查找关键内容","copyrightLogo":"assets/copyright.png","favicon":"assets/favicon.ico","autoNumber":3},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"Atonidas","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://Gitee.com/atonidas","name":"Gitee"}]}},"title":"STM32HAL系列教程","gitbook":"*","description":"Gitbook电子书示例项目"},"file":{"path":"SPI协议/CubeMX配置及主要函数.md","mtime":"2023-04-04T06:18:13.025Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-09-13T00:50:24.020Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

